home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / SASC_6.0_Disk_7.adf / Source_And_Examples / examples / data.c < prev    next >
C/C++ Source or Header  |  1992-07-30  |  2KB  |  115 lines

  1. /*  The following example has no practical use.  It is intended 
  2.     only to use to explore the data manipulation functions of 
  3.     CodeProbe.
  4. */    
  5.  
  6. #include <stdio.h>
  7.  
  8. void main (void)
  9. {
  10.    struct X {
  11.       int a;
  12.       int b[3];
  13.       int c;
  14.       } x;
  15.    
  16.    struct Y {
  17.       int a;
  18.       int b;
  19.       } y;
  20.  
  21.    typedef struct X *XPTR;
  22.          
  23.    struct W {
  24.       int x;
  25.       struct Y y[2];
  26.       int z;
  27.       } w;
  28.       
  29.    struct Z {
  30.       char c;
  31.       struct Y d;
  32.       int e;
  33.       } z;
  34.       
  35.    struct X3D {
  36.       int a;
  37.       int b[2][3][2];
  38.       int c;
  39.       } x3d;
  40.       
  41.    int i,j;
  42.    int array[10];              
  43.    int *intptr;
  44.    
  45.    long lng;
  46.    short shrt;
  47.    
  48.    float fl;
  49.    double db;
  50.  
  51.    char *string = "Hello, World";
  52.  
  53.    /*  Initialize data structures.   */
  54.    i = 33;
  55.    j = 44;
  56.    intptr = &i;
  57.    
  58.    lng = 6456;
  59.    shrt = 89;
  60.    
  61.    fl = 3.14;
  62.    db = 33.5;
  63.    
  64.    array[0] = 5;
  65.    array[1] = 15;
  66.    array[2] = 25;
  67.    array[3] = 35;
  68.    array[4] = 45;
  69.    array[5] = 55;
  70.    array[6] = 65;
  71.    array[7] = 75;
  72.    array[8] = 85;
  73.    array[9] = 95;
  74.    
  75.    x.a= 5;
  76.    x.b[0]=1;
  77.    x.b[1]=2;
  78.    x.b[2]=3;
  79.    x.c=11;
  80.    
  81.    y.a=5;
  82.    y.b=6;
  83.       
  84.    w.x=4;
  85.    w.y[0] = y;
  86.    w.y[1] = y;
  87.    w.z = 9;
  88.    
  89.    z.c = 'r';
  90.    z.d = y;
  91.    z.e=3;
  92.  
  93.    intptr = &j;
  94.       
  95.    x3d.a=2;
  96.    x3d.b[0][0][0] = 41 ;
  97.    x3d.b[0][0][1] = 42 ;
  98.    x3d.b[0][1][0] = 43 ;
  99.    x3d.b[0][1][1] = 44 ;
  100.    x3d.b[0][2][0] = 45 ;
  101.    x3d.b[0][2][1] = 46 ;
  102.    x3d.b[1][0][0] = 47 ;
  103.    x3d.b[1][0][1] = 48 ;
  104.    x3d.b[1][1][0] = 49 ;
  105.    x3d.b[1][1][1] = 50;
  106.    x3d.b[1][2][0] = 51;
  107.    x3d.b[1][2][1] = 52;
  108.    x3d.c=90;
  109.    
  110.    printf("%s!\n",string);
  111. }
  112.    
  113.    
  114.    
  115.